import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router'
import Layout from '@/layout/index.vue'
import Home from '@/views/home/index.vue'
const routes: Array<RouteRecordRaw> = [
  {
    path: '/login',
    name: 'login',
    component: () => import(/* webpackChunkName: "three-init" */ '../views/login/index.vue')
  },
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    children: [
      {
        path: '',
        name: 'home',
        component: Home
      },
      {
        path: '/three/:catalog/:id',
        name: 'three',
        component: () => import(/* webpackChunkName: "three" */ '../views/three/index.vue'),
        props: true
      },
      {
        path: '/webgl/:id',
        name: 'webgl',
        component: () => import(/* webpackChunkName: "webgl" */ '../views/webgl/index.vue'),
        props: true
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
